package com.xyz.dao.logic;

import com.free.ext.mybatis.model.entity.PageResponseModel;
import com.xyz.dao.dao.OGameDao;
import com.xyz.domain.table.OGame;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class OGameLogic {

    @Autowired
    private OGameDao oGameDao;

    public OGame add(OGame oGame){
        return oGameDao.insert(oGame);
    }

    public Integer update(OGame oGame){
        return oGameDao.update(oGame);
    }

    public List<OGame> list(OGame oGame, String orderBy){
        return oGameDao.selectList(oGame, orderBy);
    }

    public Integer delete(Integer key){
        return oGameDao.delete(key);
    }

    public PageResponseModel<OGame> pageInfo(OGame oGame, String orderBy, Integer pageNo, Integer pageSize){
        return oGameDao.selectByPageNo(oGame, orderBy, pageNo, pageSize);
    }

}